<!--
  描述：故障管理详情页
  @author chengguang
  @since 2021/11/17 15:31
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>新增或编辑分类</title>
</head>
<body>

<div class="layui-fluid">


    <div class="layui-card">
        <form method="post" action="" class="layui-form" lay-filter="zmn-form">

            <input type="hidden" name="faultId" th:value="${fault.faultId}"/>

            <div class="layui-card-header" style="margin-top:10px;"><b>基本信息</b></div>
            <div class="layui-split">&nbsp;</div>

            <!--            <div class="layui-form-item" th:if="${fault.faultId > 0}">
                            <label class="layui-form-label">ID：</label>
                            <div class="layui-input-block">
                                <div class="layui-form-mid">
                                    <span th:text="${fault.faultId}">ID</span>
                                    <span th:text="${fault.status == 2 ? '启用' : '禁用'}">status</span>
                                </div>
                            </div>
                        </div>-->
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">故障名称：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline" style="width: 200px">
                        <input type="text" name="faultName" th:value="${fault.faultName}" placeholder=""
                               lay-verify="required" autocomplete="off" class="layui-input" maxlength="50"/>
                    </div>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">故障等级：</label>
                <div class="layui-input-inline" style="width:200px">
                    <select name="faultLevel" lay-search lay-verify="required">
                        <option value="">请选择</option>
                        <option value="1" th:selected="${fault.faultLevel == 1}">简单故障</option>
                        <option value="2" th:selected="${fault.faultLevel == 2}">一般故障</option>
                        <option value="3" th:selected="${fault.faultLevel == 3}">中等故障</option>
                        <option value="4" th:selected="${fault.faultLevel == 4}">复杂故障</option>
                    </select>
                </div>
            </div>

   <!--         <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">维修难度：</label>
                <div class="layui-input-inline" style="width:200px">
                    <select name="maintainDifficulty" lay-search lay-verify="required">
                        <option value="">请选择</option>
                        <option value="3" th:selected="${fault.maintainDifficulty == 3}">大</option>
                        <option value="2" th:selected="${fault.maintainDifficulty == 2}">中</option>
                        <option value="1" th:selected="${fault.maintainDifficulty == 1}">小</option>
                    </select>
                </div>
            </div>-->


            <div  class="layui-form-item">
                <label class="layui-form-label layui-form-required">故障说明：</label>
                <div class="layui-input-block" style="width: 200px">
                    <div class="layui-inline">
                        <textarea style="width: 450px;height: 150px" onkeyup="wordStatic(this, 'faultDesc')" name="faultDesc" class="layui-textarea" lay-verify="required" th:text="${fault.faultDesc}" maxlength="200"></textarea>
                        <div style="text-align: right"><span id="faultDesc" th:text="${(fault.faultDesc == null || fault.faultDesc == '') ? 0 : #strings.length(fault.faultDesc)}">0</span>/200</div>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">排序：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline" style="width: 200px">
                        <input type="text" name="sort" th:value="${fault.sort}" placeholder="" lay-verify="sort"
                               autocomplete="off" class="layui-input" maxlength="9"/>
                    </div>
                    <div class="layui-form-mid layui-word-aux">排序值越小越靠前展示</div>
                </div>
            </div>

            <div class="layui-split">&nbsp;</div>
            <div class="layui-form-item layui-layout-admin">
                <div class="layui-input-block">
                    <div class="layui-footer" style="left: 0;">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">提交
                        </button>
                        <button class="layui-btn layui-btn-primary" id="cancleBtn">
                            取消
                        </button>
                    </div>
                </div>
            </div>

        </form>

    </div>

</div>

<script type="text/javascript" th:inline="javascript">

    var json = {
        Fault: [[${fault}]]
    };

    layui.config({
        version: "20156341",
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        plat_fault_detail: "base/fault/zmn.plat.fault.edit",
    }).use(['index', 'plat_fault_detail']);

</script>

<script type="text/javascript" th:inline="javascript">
    function wordStatic(input, id){
        var content = document.getElementById(id);
        if(content && input){
            var value = input.value.replace(/\\n|\\r/gi, '');
            content.innerText = value.length;
        }
    }
</script>
</body>
</html>